/**
 @file ctc_asw_register.h

 @author  Copyright (C) 2020 Centec Networks Inc.  All rights reserved.

 @date 2020-06-15

 @version v1.0

 This module provide functions, which is used to initialize tpid, and support global control some features.

\S ctc_register.h:ctc_global_control_type_t
*/
#ifndef _CTC_ASW_REGISTER_H
#define _CTC_ASW_REGISTER_H
#ifdef __cplusplus
extern "C" {
#endif
/***************************************************************************
*
* Header Files
*
****************************************************************************/
#include "ctc_register.h"

/***************************************************************************
*
* Defines and Macros
*
****************************************************************************/


/***************************************************************************
*
*  Functions
*
****************************************************************************/
/**
 @defgroup chip Register
 @{
*/
/**
 @brief  Set global control info

 @param[in] lchip    local chip id

 @param[in] type    a type of global control

 @param[in] value   the value to be set

 @remark[TMA]   Set global control info.

 @return CTC_E_XXX

*/
extern int32
ctc_asw_global_ctl_set(uint8 lchip, ctc_global_control_type_t type, void* value);

/**
 @brief  Get global control info

 @param[in] lchip    local chip id

 @param[in] type    a type of global control

 @param[out] value   the value to be get

 @remark[TMA]    Get global control info

 @return CTC_E_XXX

*/
extern int32
ctc_asw_global_ctl_get(uint8 lchip, ctc_global_control_type_t type, void* value);

/**
 @brief Initialize the register module

 @param[in] lchip    local chip id

 @param[in] p_global_cfg  register global config information

 @remark[TMA]   Register module init

 @return CTC_E_XXX

*/
extern int32
ctc_asw_register_init(uint8 lchip, void* p_global_cfg);

/**
 @brief De-Initialize register module

 @param[in] lchip    local chip id

 @remark[TMA]  User can de-initialize the register configuration

 @return CTC_E_XXX
*/
extern int32
ctc_asw_register_deinit(uint8 lchip);

INTERNAL extern int32
_ctc_asw_bitmap_alloc(uint8 lchip, uint32* bitmap_array, uint16 start_idx, uint16 max_idx, uint32* p_idx);

INTERNAL extern int32
_ctc_asw_bitmap_free(uint8 lchip, uint32* bitmap_array, uint32 index);

INTERNAL extern int32
_ctc_asw_bitmap_check_active(uint8 lchip, uint32* bitmap_array, uint32 index);
/**@} end of @defgroup   */
#ifdef __cplusplus
}
#endif

#endif

